import java.util.Scanner;

public class Flower {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        System.out.println("请输入一个三位数: ");
        int num=sc.nextInt();// 输入 153
        for (int i = 0; i < num ; i++) {
            int count = 0;
            int temp = i;
            while (temp != 0){
                count++;
                temp = temp / 10;
        }
            temp = i;
            int sum = 0;
            while (temp != 0){
                sum += Math.pow(temp % 10,count);
                temp = temp / 10;
            }
            if(sum == i){
                System.out.println(i);
            }
        }
    }
    public static void main1(String[] args) {
        Scanner sc = new Scanner(System.in);
        System.out.println("请输入一个三位数: ");
        int num=sc.nextInt();// 输入 153

        for (int i = 0; i <999 ; i++) {
            int a =  num/100;//商 1
            int ret = num % 100;//余数 53
            int b = ret % 10;// 个位数 3
            int c = ret / 10;// 商 5
            int sum = (a*a*a) + (c*c*c) + (b*b*b);
            if(num==sum){
               break;
                // System.out.println("sum = (a*a*a) + (c*c*c) + (b*b*b)");
            }
        }
        System.out.println("该数是：”水仙花数“");
    }
}
